package com.xiaoqi.store.entity;

import lombok.*;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @Author Rookie Coder
 * @Description 商品实体类
 * @Date
 **/
@Data
public class ProductEntity extends BaseEntity implements Serializable {

    private Integer id ;// '商品id',
    private Integer categoryId;// '分类id',
    private  String itemType ; //'商品系列',
    private String title ;// '商品标题',
    private  String sellPoint;// '商品卖点',
    private Long price ; //'商品单价',
    private  Integer num ;// '库存数量',
    private  String image ;// '图片路径',
    private  Integer status ;//'商品状态  1：上架   2：下架   3：删除',
    private  Integer priority ;// '显示优先级',

    public ProductEntity(String createdUser, Date createdTime, String modifiedUser, Date modifiedTime, Integer id, Integer categoryId, String itemType, String title, String sellPoint, Long price, Integer num, String image, Integer status, Integer priority) {
        super(createdUser, createdTime, modifiedUser, modifiedTime);
        this.id = id;
        this.categoryId = categoryId;
        this.itemType = itemType;
        this.title = title;
        this.sellPoint = sellPoint;
        this.price = price;
        this.num = num;
        this.image = image;
        this.status = status;
        this.priority = priority;
    }

    public ProductEntity() {
    }

    public ProductEntity(Integer id, Integer categoryId, String itemType, String title, String sellPoint, Long price, Integer num, String image, Integer status, Integer priority) {
        this.id = id;
        this.categoryId = categoryId;
        this.itemType = itemType;
        this.title = title;
        this.sellPoint = sellPoint;
        this.price = price;
        this.num = num;
        this.image = image;
        this.status = status;
        this.priority = priority;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public String getItemType() {
        return itemType;
    }

    public void setItemType(String itemType) {
        this.itemType = itemType;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getSellPoint() {
        return sellPoint;
    }

    public void setSellPoint(String sellPoint) {
        this.sellPoint = sellPoint;
    }

    public Long getPrice() {
        return price;
    }

    public void setPrice(Long price) {
        this.price = price;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ProductEntity)) return false;
        if (!super.equals(o)) return false;
        ProductEntity that = (ProductEntity) o;
        return Objects.equals(getId(), that.getId()) &&
                Objects.equals(getCategoryId(), that.getCategoryId()) &&
                Objects.equals(getItemType(), that.getItemType()) &&
                Objects.equals(getTitle(), that.getTitle()) &&
                Objects.equals(getSellPoint(), that.getSellPoint()) &&
                Objects.equals(getPrice(), that.getPrice()) &&
                Objects.equals(getNum(), that.getNum()) &&
                Objects.equals(getImage(), that.getImage()) &&
                Objects.equals(getStatus(), that.getStatus()) &&
                Objects.equals(getPriority(), that.getPriority());
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), getId(), getCategoryId(), getItemType(), getTitle(), getSellPoint(), getPrice(), getNum(), getImage(), getStatus(), getPriority());
    }

    @Override
    public String toString() {
        return "ProductEntity{" +
                "id=" + id +
                ", categoryId=" + categoryId +
                ", itemType='" + itemType + '\'' +
                ", title='" + title + '\'' +
                ", sellPoint='" + sellPoint + '\'' +
                ", price=" + price +
                ", num=" + num +
                ", image='" + image + '\'' +
                ", status=" + status +
                ", priority=" + priority +
                '}';
    }
}
